package com.cheng.example.geektime.designpatterns.j57;


/**
 * 通知观察者
 */
public class RegNotificationObserver implements RegObserver {

    private RegNotificationService regNotificationService = new RegNotificationService();

    @Override
    public void handleRegSuccess(long userId) {

        regNotificationService.sendInboxMessage(userId,"Welcome...");

//        //第一种实现异步的方式
//        Thread thread = new Thread(() -> {
//            regNotificationService.sendInboxMessage(userId,"Welcome...");
//        });
//        thread.start();
    }
}
